<?php

 
 Zend_Loader::loadClass("BaseDBRows");
 Zend_Loader::loadClass("Fisher");
 class Fishers extends BaseDBRows
 {
 	protected function setUp()
 	{
 		$this->_tableName = Fisher::_tablename;
 	}	
	
	public function getFirstherByOrg($org_id){
	
		Zend_Loader::loadClass("FishingArea");
		Zend_Loader::loadClass("QueryCreator");
		
		$query = new QueryCreator();
		$query->addSelect("first_name,last_name,fisher_id");
		$query->addFrom(FishingArea::_tablename . " fa ");
		$query->addJoin("LEFT JOIN ". $this->_tableName . " f on fa.fishing_area_id = f.fishing_area_id ");
		
		$query->addWhere(" fa.org_id = ". $org_id );
		$query->addOrderBy("last_name");
		
		$db = DBCon::instance();
		//echo $query->createSQL();
		$result = $db->executeQuery($query->createSQL());
		
		return $result;
		
	
	}
 }
?>